<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="PoJo.Person" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.User" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="e" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Distance
  Date: 2021/10/19
  Time: 15:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
   <table border="1" cellspacing="0" cellpadding="0">
      <c:forEach begin="1" end="10" var="i">
          <tr>
              <td>
                  ${i}
              </td>
          </tr>
      </c:forEach>
   </table>
   <%

   %>
   <c:forEach items="${requestScope.Array}" var="i">
        ${i}
   </c:forEach>
   <%
       Map<String,Object> map = new HashMap<>();
       map.put("key1",1);
       map.put("key2",2);
       map.put("key3",3);
       request.setAttribute("Map",map);
   %>
   <br>
   <c:forEach items="${requestScope.Map}" var="entry">
       ${entry}<br>
       ${entry.key}<br>
       ${entry.value}<br>
   </c:forEach>
   <%
       List<User> personList = new ArrayList<>();
       for (int i = 1; i <11 ; i++) {
           personList.add(new User(i,"Stu"+i,"Pass"+i,"Email"+i));
       }
       request.setAttribute("list",personList);
   %>

   <style>
       .table1{
           width: 680px;
       }

   </style>


<table border="1"  cellspacing="0" class="table1" >
    <tr>
        <th>ID</th>
        <th>账号</th>
        <th>密码</th>
        <th>邮箱</th>
        <th>操作</th>
    </tr>

    <e:forEach items="${requestScope.list}"  var="list">
        <tr align="center">
        <td>${list.id}</td>
        <td>${list.username}</td>
        <td>${list.password}</td>
        <td>${list.email}</td>
        <td>增加、修改</td>
        </tr>
</e:forEach>

    <table border="1"  cellspacing="0" class="table1" >
        <tr>
            <th>ID</th>
            <th>账号</th>
            <th>密码</th>
            <th>邮箱</th>
            <th>操作</th>
        </tr>
    <br>
        <e:forEach begin="2" items="${requestScope.list}" var="list" varStatus="status">
            <tr align="center">
                <td>${list.id}</td>
                <td>${list.username}</td>
                <td>${list.password}</td>
                <td>${list.email}</td>
                <td>${status.current}</td>
                <td>${status.index}</td>
                <td>${status.count}</td>>
                <td>增加、修改</td>
            </tr>
        </e:forEach>
</table>

   <% String [] name = new String []{"1","2","3"};
       request.setAttribute("String",name);
   %>

   ${String[0]}
</body>
</html>
